package net.randomice.emf.observables.demo.extlibrary.persons.observables;

import java.util.List;
import java.util.Map;
import net.randomice.emf.observables.demo.extlibrary.ExtlibraryPackage;
import net.randomice.emf.observables.demo.extlibrary.persons.Person;
import net.randomice.emf.observables.demo.extlibrary.persons.PersonsPackage;
import org.eclipse.core.databinding.observable.map.IObservableMap;
import org.eclipse.emf.databinding.EMFObservables;

/**
 * An Observable map wrapper for Person
 * @generated
 */
public class PersonOM<FromType> {
	public final IObservableMap o;

	public PersonOM(Class<? extends FromType> clazz,
			IObservableMap observableMap) {
		// org.eclipse.core.runtime.Assert.isTrue(clazz.equals(observableMap.getKeyType()));
		// org.eclipse.core.runtime.Assert.isTrue(Person.class.equals(observableMap.getValueType()));
		o = observableMap;
	}

	@SuppressWarnings("unchecked")
	public Map<FromType, Person> getMap() {
		return (Map<FromType, Person>) o;
	}

	@SuppressWarnings("unchecked")
	public List<Person> getValueList() {
		return (List<Person>) o.values();
	}

	// features from type Addressable

	//public EStringObservableObject getAddress(){
	//	return new EStringObservableObject(EMFObservables.observeDetailValue(o.getRealm(),
	//			o, ExtlibraryPackage.Literals.ADDRESSABLE__ADDRESS));
	//}

	// features from type Person

	//public EStringObservableObject getFirstName(){
	//	return new EStringObservableObject(EMFObservables.observeDetailValue(o.getRealm(),
	//			o, PersonsPackage.Literals.PERSON__FIRST_NAME));
	//}

	//public EStringObservableObject getLastName(){
	//	return new EStringObservableObject(EMFObservables.observeDetailValue(o.getRealm(),
	//			o, PersonsPackage.Literals.PERSON__LAST_NAME));
	//}

}
